<div class="table-header mt20 clearfix">
    <span class="fl lh30 f14 text-indent">楼盘动态列表：</span>
    <div class="fr btn-group">
        <a href="javascript: void(0)" class="btn btn-yellow permission p-500309-10" id="btn_add">添加楼盘动态</a>
    </div>
</div>
<div class="table-wrap mt10">
    <table width="100%">
        <thead>
            <tr>
                <th width="50">序号</th>
                <th>楼盘动态标题</th>
                <th width="150">创建时间</th>
                <th width="120">操作</th>
            </tr>
        </thead>
        <tbody id="dynamic_grid">
            <script id="dynamic_row_tmpl" type="text/html">
            {{if list.length > 0}}
                {{each list as value i}}
                <tr>
                    <td height="40">{{i + 1}}</td>
                    <td>
                        <p>{{value.dynamic_title}}</p>
                    </td>
                    <td>{{value.CreatedOn | dateFormat:'yyyy-MM-dd'}}</td>
                    <td id="{{value.b_regbroker_building_dynamicId}}">
                        <div class="js-oper-btn" style="display: none;">
                        <a href="javascript:void(0);" class="c-orange js-edit permission p-500309-10-inline">编辑</a>&nbsp;&nbsp;&nbsp;
                        <a href="javascript:void(0);" class="c-orange js-del permission p-500309-10-inline">删除</a>
                        </div>
                    </td>
                </tr>
                {{/each}}
            {{else}}
                <tr><td colspan="4"><div class="no-data"><span>暂无数据!</span></div></td></tr>
            {{/if}}
            </script>
        </tbody>
    </table>
</div>
<div id="dynamic_pager" class="pagination"></div>
<!-- 新增楼盘动态 -->
<script id="add_dynamic_tmpl" type="text/html">
<div style="max-height: 500px;overflow: auto;">
    <table width="100%">
      <tr>
        <td width="135" align="right" class="form-cell" valign="top">楼盘动态标签：</td>
        <td class="cell-split">            
            <div class="fl select" style="width:400px;" id="ddl_label">
                <span class="select-border js-select">
                    <input class="select-text" type="text" readonly placeholder="" />
                    <span class="select-icon"><i class="select-icon-arrow"></i></span>
                </span>
                <div class="select-sub"></div>
            </div>
         </td>
      </tr>
      <tr>
        <td align="right" class="form-cell" valign="top"><span class="c-red">* </span>楼盘动态标题：</td>
        <td class="cell-split-s">
            <input type="text" id="dynamic_title" class="input-text fl mr10" value="{{dynamic_title}}" style="width:400px" maxlength="50"><p class="c-gray lh30">最多50个汉字</p>
        </td>
      </tr>
      <tr>
        <td align="right" class="form-cell" valign="top">是否显示封面图：</td>
        <td class="cell-split">
          <div class="switch {{if is_show == 1}}switch-on{{else}}switch-off{{/if}}" style="margin-top:3px" id="btn_is_show">
              <span class="switch-text">{{if is_show == 1}}开{{else}}关{{/if}}</span>
              <span class="switch-white"></span>
          </div>
        </td>
      </tr>
      <tr>
        <td align="right" class="form-cell" valign="top">封面图片地址：</td>
        <td class="cell-split">
            <div id="fileupload" class="fileinput-button fl">
                <div class="upload-wrap" id="img_wrap">
                    {{if pic_url && pic_url != ""}}
                          <img src="{{pic_url}}" alt="" />
                    {{else}}
                          <div class="upload-btn"><i class="upload-icon"></i></div>
                    {{/if}}
                </div>
                <input type="file" name="file" accept="image/*" />
                <div class="fl lh30 mt20">
                    <p class="c-gray f12">建议尺寸：610*320像素</p>
                      <span >
                          <span class="c-blue f12">上传图片</span>
                      </span>
                </div>
            </div>
            <input type="hidden" id="pic_url" value="{{pic_url}}" />
            <p class="c-red lh30 none js-err" style="clear:both;"></p>
        </td>
      </tr>
      <tr>
        <td align="right" class="form-cell" valign="top"><span class="c-red">* </span>楼盘动态内容：</td>
        <td class="cell-split">
            <div id="editor" style="width:550px;height:180px;"></div>
        </td>
      </tr>
    </table>
</div>
</script>
<script type="text/javascript">
seajs.use(["jquery","service/config/building_dynamic"], function ($,building_dynamic){
    $(function(){
        building_dynamic.init();
    });
});
</script>